home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / filutil / flex247x.zip / FLEX247 / MAKEFILE < prev    next >
Text File  |  1994-09-28  |  3KB  |  137 lines

  1. ###############################################################################
  2. # Makefile for flex 2.4.7 with Borland C/C++ version 4.02
  3. #
  4. # This will probably need to be adjusted for your existing lexer/parser
  5. # generators.  See definitions for FLEX and YACC near the bottom of the
  6. # makefile.
  7. #
  8. # Copy initscan.c to scan.c to make your first executable.  After that,
  9. # you may choose to try alternate compression options for your everyday
  10. # flex executable.
  11. #
  12. # This will build flex with the large model.  Don't use huge, but if you
  13. # feel like experimenting with other models, post your success stories to 
  14. # comp.compilers, OK?
  15. #
  16. # This makefile does *not* implement the big testing found in "makefile.in".
  17. #
  18. # I also assume the availability of sed and the gnu file utilities on the
  19. # system - they're readily available, so if you don't have them, why not?
  20. #                                                                 <grin>
  21. #
  22. # The resulting generated lexer (the real goal, right?) will compile
  23. # (and run nicely, too) as a .c file, as well as being included such as
  24. # extern "C" { #include "lexyyc" } in a .cplusplus file.
  25. #
  26. ###############################################################################
  27.  
  28. DEBUG = 1
  29.  
  30. .autodepend
  31.  
  32. all:    flex.exe
  33.  
  34. ###############################################################################
  35. #
  36. # standard utilitities? ha.
  37. #
  38.  
  39. CC    = bcc
  40. CPP     = bcc
  41.  
  42. ###############################################################################
  43. #
  44.  
  45. MODEL    = l
  46.  
  47. !if $(DEBUG) == 1
  48. !message Building with debug.
  49. debugCompile = -v
  50. debugLink = /v
  51. !else
  52. !message Building without debug.
  53. debugCompile =
  54. debugLink =
  55. !endif
  56.  
  57. LOADER    = c0$(MODEL).obj
  58. LIBS    = c$(MODEL).lib
  59. LINKFLAGS = $(debugLink)
  60.  
  61. DATASEG    = -dc -Ff
  62. SizeOPT    = -Os -G-
  63. Defines = -DSHORT_FILE_NAMES=1 -DHAVE_STRING_H=1
  64.  
  65. COMMON    = -A -c -m$(MODEL) $(SizeOPT) $(DATASEG) $(Defines) $(debugCompile)
  66. CFLAGS  = -o$@ $(COMMON)
  67. CCFLAGS  = -o$@ $(COMMON) -Pcc
  68.  
  69. ###############################################################################
  70.  
  71. .SUFFIXES:    .cc
  72.  
  73. .cc.obj:
  74.     $(CPP) $(CCFLAGS) $<
  75.  
  76. .c.obj:
  77.     $(CPP) $(CFLAGS) $<
  78.  
  79. ###############################################################################
  80. #
  81. # source & object files
  82. #
  83.  
  84. SRC =    ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
  85.     scan.c sym.c tblcmp.c yylex.c skel.c
  86.  
  87. OBJS = $(SRC:.c=.obj)
  88.  
  89. objects:    $(OBJS)
  90.     @echo $(OBJS)
  91.  
  92. ###############################################################################
  93. #
  94. # Executable
  95. #
  96.  
  97. flex.exe:      $(OBJS)
  98.     tlink $(LINKFLAGS) @&&!
  99. $(LOADER) $**
  100. $&.exe
  101. $&.map
  102. $(LIBS)
  103. !
  104.  
  105. ###############################################################################
  106. #
  107. # Lex files
  108. #
  109.  
  110. FLEX    = .\flex
  111. FLEX_FLAGS = -ist
  112.  
  113. scan.c: scan.l
  114.     $(FLEX) $(FLEX_FLAGS) scan.l >scan.tmp
  115.     sed s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.tmp >scan.c
  116.     @rm scan.tmp
  117.  
  118. ###############################################################################
  119. #
  120. # YACC files
  121. #
  122.  
  123. YACC    = .\bison
  124. YFLAGS  = -vdyl
  125.  
  126. parse.c: parse.y
  127.     $(YACC) -ydl parse.y
  128.     @sed "/extern char.*malloc/d" <y_tab.c >parse.c
  129.     @rm -f y_tab.c
  130.     @mv y_tab.h parse.h
  131.  
  132. #
  133. # end Makefile
  134. #
  135. ###############################################################################
  136.